<%@ page import="java.sql.*"%>
<%@ include file="dbconn.jsp" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Account Information</title>
<link href="/tros/menuMain.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width=100% bordercolor="#C6D4E1" bgcolor="#C6D4E1">
<tr><th scope="col"><div align="center"><h1 align="center"><font face="Times New Roman">Tros - Online Banking System </font></h1></div></th></tr>
</table>
<div id="overall" align="center">
<div id="dropdwn" align="center">
<ul>
<li><a href='custHome.jsp?value=<%=session.getAttribute( "currentID" )%>'>Home</a>
</li>
</ul>
<ul>
<li><a href='accountInfo.jsp?value=<%=session.getAttribute( "currentID" )%>'>Account</a>
<ul>
<li><a href='viewBalance.jsp?value=<%=session.getAttribute( "currentID" )%>'>View Balance</a></li>
<li><a href='viewTransaction.jsp?value=<%=session.getAttribute( "currentID" )%>'>View Transactions</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='transferMain.jsp?value=<%=session.getAttribute( "currentID" )%>'>Transfer</a>
<ul>
<li><a href='depositMain.jsp?value=<%=session.getAttribute( "currentID" )%>'>Deposit</a></li>
<li><a href='withdrawal.jsp?value=<%=session.getAttribute( "currentID" )%>'>Withdraw</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='creditCard.jsp?value=<%=session.getAttribute( "currentID" )%>'>Credit Card</a>
</li>
</ul>
<ul>
<li><a href='paybills.jsp?value=<%=session.getAttribute( "currentID" )%>'>Pay Bills</a>
</li>
</ul>
<ul>
<li><a href='investMain.jsp?value=<%=session.getAttribute( "currentID" )%>'>Investments</a>
<ul>
<li><a href='viewShareInv.jsp?value=<%=session.getAttribute( "currentID" )%>'>Current Shares</a></li>
<li><a href='viewFdInv.jsp?value=<%=session.getAttribute( "currentID" )%>'>Current Fixed Deposit</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='updatePer.jsp?value=<%=session.getAttribute( "currentID" )%>'>Update Personal Info</a>
<ul>
<li><a href='changePass.jsp?value=<%=session.getAttribute( "currentID" )%>'>Change Password</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='logout.jsp'>Log Out</a></li>
</ul>
<br class="flow" />
</div>
</div>
&nbsp;
&nbsp;
<fieldset>
<legend><b>Account</b></legend>
<h3 align=center> Account Information</h3>
<p align=center>Below are the Account details maintained</p>
<table width=100% align=center cellpadding=5 cellspacing=0 bgcolor="#D5FFD5">
<tr><td>&nbsp;</td><tr>
<tr><td><b> Savings Account </b></td><tr>
<tr><td>&nbsp;</td><tr>
<%
Statement reqst = connect.createStatement();
ResultSet result =reqst.executeQuery("SELECT * FROM SAVACC WHERE CUSTOMERID="+session.getAttribute( "currentID" ));
while(result.next())
  {
      String Balance=result.getString("ACC_BALANCE");
      String SaccNo=result.getString("SAVACCNO");   
      String expDate=result.getString("EXPIRY_DATE"); 
      String lname=result.getString("LASTNAME");
 %>
<tr align=center>
<td><b>Account No</b></td>
<td><b>Last Name</b></td>
<td><b>Expiry Date</b></td>
<td><b>Mini Statement</b></td>
</tr>
<tr align=center>
<td><a href='viewBalance.jsp?value=<%="sav"+SaccNo%>'><%=SaccNo%></a></td>
<td><%=lname%></td>
<td><%=expDate%></td>
<td><a href='viewTransaction.jsp?value=<%="sav"+SaccNo%>'>View</a></td>
</tr>
<%
  }
result.close();
%>
<tr><td>&nbsp;</td><tr>
<tr><td><b> Checking Account </b></td><tr>
<tr><td>&nbsp;</td><tr>
<%
try
{
	
	Statement reqst1 = connect.createStatement();
	ResultSet result1 =reqst1.executeQuery("SELECT * FROM CHCKACC WHERE CUSTOMERID="+session.getAttribute( "currentID" ));
	while(result1.next())
	  {
	      String Balance=result1.getString("ACC_BALANCE");
	      String ChaccNo=result1.getString("CHCKACCNO");   
	      String expDate=result1.getString("EXPIRY_DATE"); 
	      String lname=result1.getString("LASTNAME");
	      
	      %>
	      <tr align=center>
	      <td><b>Account No</b></td>
	      <td><b>Last Name</b></td>	      
	      <td><b>Expiry Date</b></td>
	      <td><b>Mini Statement</b></td>
	      </tr>
	      <tr align=center>
	      <td><a href='viewBalance.jsp?value=<%="chk"+ChaccNo%>'><%=ChaccNo%></a></td>
	      <td><%=lname%></td>	     
	      <td><%=expDate%></td>
	      <td><a href='viewTransaction.jsp?value=<%="chk"+ChaccNo%>'>View</a></td>
	      </tr>
    <%
	  }
	result1.close();
	
}catch(Exception e)
{
	System.out.println("--------------->"+e.getMessage());
}
%>
<tr><td>&nbsp;</td><tr>
<tr><td>&nbsp;</td><tr>
</table>
</fieldset>
</body>
</html>